/* --------------------------------------------------------
 * Copyright (c) aeky , Inc.  All rights reserved.
 * --------------------------------------------------------
 */
package com.aeky.server.support;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.web.HttpRequestHandler;
import org.springframework.web.context.ServletConfigAware;
import org.springframework.web.context.ServletContextAware;

import com.google.gwt.user.client.rpc.RemoteService;

/**
 * Interface for RPC exporters.
 */
public interface RPCServiceExporter extends HttpRequestHandler, InitializingBean, ServletContextAware,
        ServletConfigAware {

    /**
     * Set the service object to which RPCs should be delegated.
     * 
     * @param service service
     */
    void setService(Object service);

    /**
     * Declare Interfaces that will be bound to RPC.
     * 
     * @param interfaces Array of Interfaces
     */
    void setServiceInterfaces(Class<RemoteService>[] interfaces);

    /**
     * Set state of response caching.
     * 
     * @param caching caching flag
     */
    void setResponseCachingDisabled(boolean caching);

    /**
     * When enabled will throw exceptions which originate from the service and
     * have not been declared in the RPC interface back to the servlet
     * container.
     * 
     * @param throwUndeclaredExceptionToServletContainer
     *            throwUndeclaredExceptionToServletContainer
     */
    void setThrowUndeclaredExceptionToServletContainer(boolean throwUndeclaredExceptionToServletContainer);
}
